<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.editCourseTitle}"></h:outputText>
        </ui:define>
        <ui:define name="content">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.courseCode}:" for="courseCode" />
                    <h:inputText id="courseCode" value="#{courseController.selected.courseCode}" title="#{bundle.courseCode}" required="true" requiredMessage="#{bundle.OBLIG}" />
                    <h:outputLabel value="#{bundle.nameEn}:" for="courseName" />
                    <h:inputText id="courseName" value="#{courseController.selected.courseName}" title="#{bundle.nameEn}" required="true" requiredMessage="#{bundle.OBLIG}"/>
                    <h:outputLabel value="#{bundle.nameNo}:" for="courseNameNo" />
                    <h:inputText id="courseNameNo" value="#{courseController.selected.courseNameNo}" title="#{bundle.nameNo}" required="true" requiredMessage="#{bundle.OBLIG}"/>
                    <h:outputLabel value="#{bundle.ectsCredits}:" for="ectsCredits" />
                    <h:inputText id="ectsCredits" value="#{courseController.selected.ectsCredits}" title="#{bundle.ectsCredits}" />
                    <h:outputLabel value="#{bundle.semester}:" for="semester" />
                    <h:selectOneMenu id="semester" value="#{courseController.selected.semester}" title="#{bundle.semester}">
                        <f:selectItems value="#{courseController.semesterSelectItems}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.courseLanguage}:" for="courseLanguage" />
                    <h:selectOneMenu id="courseLanguage" value="#{courseController.selected.courseLanguage}" title="#{bundle.courseLanguage}">
                        <f:selectItems value="#{courseController.courseLanguageSelectItems}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.previousKnowledgeEn}:" for="previousKnowledge" />
                    <h:inputTextarea rows="4" cols="30" id="previousKnowledge" value="#{courseController.selected.previousKnowledge}" title="#{bundle.previousKnowledgeEn}" />
                    <h:outputLabel value="#{bundle.previousKnowledgeNo}:" for="previousKnowledgeNo" />
                    <h:inputTextarea rows="4" cols="30" id="previousKnowledgeNo" value="#{courseController.selected.previousKnowledgeNo}" title="#{bundle.previousKnowledgeNo}" />
                </h:panelGrid>
                <h:commandLink value="#{bundle.addOutcomeLink}" action="#{courseController.createOutcome}" />
                <h:panelGrid columns="2">
                    <h:outputText value="#{bundle.outcomes}:" />
                    <h:panelGroup layout="block">
                        <h:outputText value="#{bundle.outcomeType1}" />
                        <h:dataTable value="#{courseController.knowledgeOutcomes}" var="outcome">
                            <h:column>
                                <h:outputText value="#{outcome.text}" />
                                <h:outputText value="#{outcome.textNo}" />
                                <h:commandLink action="#{courseController.editKnowledgeOutcome}" value="#{bundle.EDIT}" />
                                <h:commandLink action="#{courseController.destroyKnowledgeOutcome}" value="#{bundle.DESTROY}" />
                            </h:column>
                        </h:dataTable>
                        <h:outputText value="#{bundle.outcomeType2}" />
                        <h:dataTable value="#{courseController.skillOutcomes}" var="outcome">
                            <h:column>
                                <h:outputText value="#{outcome.text}" />
                                <h:outputText value="#{outcome.textNo}" />
                                <h:commandLink action="#{courseController.editSkillOutcome}" value="#{bundle.EDIT}" />
                                <h:commandLink action="#{courseController.destroySkillOutcome}" value="#{bundle.DESTROY}" />
                            </h:column>
                        </h:dataTable>
                        <h:outputText value="#{bundle.outcomeType3}" />
                        <h:dataTable value="#{courseController.generalOutcomes}" var="outcome">
                            <h:column>
                                <h:outputText value="#{outcome.text}" />
                                <h:outputText value="#{outcome.textNo}" />
                                <h:commandLink action="#{courseController.editGeneralOutcome}" value="#{bundle.EDIT}" />
                                <h:commandLink action="#{courseController.destroyGeneralOutcome}" value="#{bundle.DESTROY}" />
                            </h:column>
                        </h:dataTable>
                    </h:panelGroup>
                    <h:outputLabel value="#{bundle.courseContentEn}:" for="courseContent" />
                    <h:inputTextarea rows="4" cols="30" id="courseContent" value="#{courseController.selected.courseContent}" title="#{bundle.courseContentEn}" />
                    <h:outputLabel value="#{bundle.courseContentNo}:" for="courseContentNo" />
                    <h:inputTextarea rows="4" cols="30" id="courseContentNo" value="#{courseController.selected.courseContentNo}" title="#{bundle.courseContentNo}" />
                    <h:outputLabel value="#{bundle.studyActivitiesEn}:" for="studyActivities" />
                    <h:inputTextarea rows="4" cols="30" id="studyActivities" value="#{courseController.selected.studyActivities}" title="#{bundle.studyActivitiesEn}" />
                    <h:outputLabel value="#{bundle.studyActivitiesNo}:" for="studyActivitiesNo" />
                    <h:inputTextarea rows="4" cols="30" id="studyActivitiesNo" value="#{courseController.selected.studyActivitiesNo}" title="#{bundle.studyActivitiesNo}" />
                    <h:outputLabel value="#{bundle.formOfAssessmentEn}:" for="formOfAssessment" />
                    <h:inputTextarea rows="4" cols="30" id="formOfAssessment" value="#{courseController.selected.formOfAssessment}" title="#{bundle.formOfAssessmentEn}" />
                    <h:outputLabel value="#{bundle.formOfAssessmentNo}:" for="formOfAssessmentNo" />
                    <h:inputTextarea rows="4" cols="30" id="formOfAssessmentNo" value="#{courseController.selected.formOfAssessmentNo}" title="#{bundle.formOfAssessmentNo}" />
                    <h:outputLabel value="#{bundle.resitRequirementsEn}:" for="resitRequirements" />
                    <h:inputTextarea rows="4" cols="30" id="resitRequirements" value="#{courseController.selected.resitRequirements}" title="#{bundle.resitRequirementsEn}" />
                    <h:outputLabel value="#{bundle.resitRequirementsNo}:" for="resitRequirementsNo" />
                    <h:inputTextarea rows="4" cols="30" id="resitRequirementsNo" value="#{courseController.selected.resitRequirementsNo}" title="#{bundle.resitRequirementsNo}" />
                    <h:outputLabel value="#{bundle.supportMaterialEn}:" for="supportMaterial" />
                    <h:inputTextarea rows="4" cols="30" id="supportMaterial" value="#{courseController.selected.supportMaterial}" title="#{bundle.supportMaterialEn}" />
                    <h:outputLabel value="#{bundle.supportMaterialNo}:" for="supportMaterialNo" />
                    <h:inputTextarea rows="4" cols="30" id="supportMaterialNo" value="#{courseController.selected.supportMaterialNo}" title="#{bundle.supportMaterialNo}" />
                    <h:outputLabel value="#{bundle.courseworkRequirementsEn}:" for="courseworkRequirements" />
                    <h:inputTextarea rows="4" cols="30" id="courseworkRequirements" value="#{courseController.selected.courseworkRequirements}" title="#{bundle.courseworkRequirementsEn}" />
                    <h:outputLabel value="#{bundle.courseworkRequirementsNo}:" for="courseworkRequirementsNo" />
                    <h:inputTextarea rows="4" cols="30" id="courseworkRequirementsNo" value="#{courseController.selected.courseworkRequirementsNo}" title="#{bundle.courseworkRequirementsNo}" />
                    <h:outputLabel value="#{bundle.readingList}:" for="readingList" />
                    <h:inputTextarea rows="4" cols="30" id="readingList" value="#{courseController.selected.readingList}" title="#{bundle.readingList}" />
                    <h:outputLabel value="#{bundle.faculty}:" for="faculty" />
                    <h:selectOneMenu id="faculty" value="#{courseController.selected.faculty}" title="#{bundle.faculty}" required="true" requiredMessage="#{bundle.OBLIG}">
                        <f:selectItems value="#{facultyController.itemsAvailableSelectManyOfMyFaculties}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{courseController.update}" value="#{bundle.SAVE}"/>
                <br />
                <h:commandLink action="#{courseController.destroy}" value="#{bundle.DELETE}"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CANCEL}" action="mypage" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
